from drf_spectacular.utils import extend_schema
from rest_framework import viewsets

from .models import Department, Position, Role
from .serializers import (DepartmentSerializer, PositionSerializer,
                          RoleSerializer)


@extend_schema(tags=["System"])
class DepartmentViewSets(viewsets.ModelViewSet):
    queryset = Department.objects.all()  # 数据来源
    serializer_class = DepartmentSerializer  # 数据格式


@extend_schema(tags=["System"])
class PositionViewSets(viewsets.ModelViewSet):
    queryset = Position.objects.all()  # 数据来源
    serializer_class = PositionSerializer  # 数据格式


@extend_schema(tags=["System"])
class RoleViewSets(viewsets.ModelViewSet):
    queryset = Role.objects.all()  # 数据来源
    serializer_class = RoleSerializer  # 数据格式
